import {defineStore}  from "pinia"

export const useCart =defineStore('cart',{
    state(){
        return{
            addList:[]
        }
    },
    getters:{
        total(state){
            return(state.addList.reduce((total,item)=>{
                return total +=item.price*item.count
            },0)).toFixed(2)
        }
    }
 
})